﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TeamTasker.Contracts;
using TeamTasker.Server.DataAccess;

namespace TeamTasker.Server.BusinessLogic
{
    public class BaseFacade<EntityType, DaoType>
        where EntityType : BaseRecord
        where DaoType : BaseDAO<EntityType>
    {
        private DaoType dao;

        public DaoType Dao
        {
            get { return dao; }
            set { dao = value; }
        }

        public virtual EntityType Load(long id)
        {
            return Dao.Load(id);
        }

        public virtual void Save(EntityType entity)
        {
            Dao.Save(entity);
        }

        public virtual void Delete(long id)
        {
            Dao.Delete(id);
        }
    }
}
